#include "StdAfx.h"

#include "MapRequest.h"

MapRequest::MapRequest(void)
{
	zoom = 10;
	sizex=470;
	sizey=750;

	step = 0.001;

	centerx = 39.914728;
	centery = 116.398672;
	url = "http://ditu.google.cn/staticmap?center=40.714728,-73.998672&zoom=14&size=512x512&maptype=mobile\&markers=39.949328,116.3875,blues|39.949328,116.3775,greeng|39.943028,116.3975,redc\&key=MAPS_API_KEY&sensor=false";
}

MapRequest::~MapRequest(void)
{

}

CString MapRequest::getMapUrl()
{
	CString rst=L"";

	rst.Format(L"/staticmap?center=%.6f,%.6f&zoom=%d&size=%dx%d&maptype=mobile\&markers=%.6f,%.6f,blues|39.949328,116.3775,greeng|39.943028,116.3975,redc\&key=MAPS_API_KEY&sensor=false",
		centerx,centery,zoom,sizex,sizey,centerx,centery);

	return rst;

}

CString MapRequest::getMapServer()
{
	return L"ditu.google.cn";
}

void  MapRequest::up()
{
   centerx-=step;
}
void MapRequest::down(){
   centerx+=step;
}
void MapRequest::left(){
   centery-=step;
}

void MapRequest::right(){
    centery+=step;
}